home *** CD-ROM | disk | FTP | other *** search
/ Champak 66 / Vol 66.iso / games / doodle_d.swf / scripts / DefineSprite_54_en1 / frame_1 / DoAction.as
Text File  |  2013-04-24  |  1KB  |  59 lines

  1. function onEnterFrame()
  2. {
  3.    if(_root.shieldMC.hitTest(_X,_Y,true))
  4.    {
  5.       dx = 0;
  6.       dy = 0;
  7.    }
  8.    _X = _X + dx;
  9.    _Y = _Y + dy;
  10.    if(_X < 0 || _X > 640 || _Y > 880 || _Y < 0)
  11.    {
  12.       dir -= 180;
  13.       _rotation = dir;
  14.       degrees = dir;
  15.       degrees -= 90;
  16.       radians = degrees * _root.rad;
  17.       statMovX = 10 * Math.cos(radians);
  18.       statMovY = 10 * Math.sin(radians);
  19.       thrustDX = speed * Math.cos(radians);
  20.       thrustDY = speed * Math.sin(radians);
  21.       dx = thrustDX;
  22.       dy = thrustDY;
  23.    }
  24.    if(this.hitTest(_root.ship))
  25.    {
  26.       depth = _root.getNextHighestDepth();
  27.       _root.attachMovie("exp","exp" + depth,depth);
  28.       exp = eval("_root.exp" + depth);
  29.       exp._x = _X;
  30.       exp._y = _Y;
  31.       _root.death();
  32.       _root.eAmount--;
  33.       this.removeMovieClip();
  34.    }
  35.    if(h <= 0)
  36.    {
  37.       _root.eAmount--;
  38.       _root.points += 20;
  39.       _root.eD = _root.eD + 1;
  40.       depth = _root.getNextHighestDepth();
  41.       _root.attachMovie("exp","exp" + depth,depth);
  42.       exp = eval("_root.exp" + depth);
  43.       exp._x = _X;
  44.       exp._y = _Y;
  45.       this.removeMovieClip();
  46.    }
  47. }
  48. dir = Math.random() * 360;
  49. _rotation = dir;
  50. degrees = dir;
  51. degrees -= 90;
  52. radians = degrees * _root.rad;
  53. statMovX = 10 * Math.cos(radians);
  54. statMovY = 10 * Math.sin(radians);
  55. thrustDX = speed * Math.cos(radians);
  56. thrustDY = speed * Math.sin(radians);
  57. dx = thrustDX;
  58. dy = thrustDY;
  59.